import java.lang.*;

public class PrimeNum {
    public static void main(String[] args) {
        final int NUMBER_OF_PRIMES = 10;
        final int NUMBER_OF_PRIMES_PER_LINES = 10;
        int count = 0;
        int num = 2;
        
        System.out.print("Pirmskaitļi ir ");
        
        while(count < NUMBER_OF_PRIMES) {
            boolean isPrime = true;
            for(int divisor = 2; divisor <= num / 2; divisor++) {
                if(num % divisor == 0) {
                    isPrime = false;
                    break;
                }
            }
            if(isPrime) {
                count++;
                if(count % NUMBER_OF_PRIMES_PER_LINES == 0) {
                    System.out.println(num);
            }
            else
                System.out.print(num + " ");
        }
        num++;
        }
    }
}